import matplotlib.pyplot as plt
import pandas as pd

df = pd.read_excel('学生各学期成绩表.xlsx')
plt.figure(figsize=(10, 8))
x = df['序号']
y = df['语文']
plt.rcParams['font.sans-serif'] = 'SimHei'
plt.title('学生各学期成绩分析')
plt.xlabel('学期')
plt.ylabel('成绩')
for a, b in zip(df['序号'], df['语文']):
    plt.text(a, b, '%.1f' % b, ha='center')
plt.grid(axis='y')
plt.xticks(range(11), df['学期'], rotation=15)
plt.plot(x, y)
plt.legend(('语文',))
plt.show()
